class CPUInfo
  def initialize()
    @cpu_info = Hash.new
    cpu_number = 0
    cpuinfo = IO.readlines("/proc/cpuinfo")
    cpuinfo.each do |line|
      if (line.length <= 1)
        cpu_number += 1
        next
      end
      fields = line.split(/:/, 2)
      field_name = fields[0].strip
      field_value = fields[1].strip
      @cpu_info["#{cpu_number.to_s}_#{field_name}"] = field_value
    end
  end
end
